﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyBBS.Data.Models;

namespace MyBBS.Data.Filters
{
    public static class CommentFilter
    {
        public static Comment WithIDEquals(this IQueryable<Comment> comment, long id)
        {
            return comment.Single(c => c.ID == id);
        }

        public static IQueryable<Comment> WithPostIDEquals(this IQueryable<Comment> comments, long postId)
        {
            return from c in comments
                   where c.PostID == postId
                   select c;
        }
    }
}
